﻿using B.S.Traceable.ErrorCode;
using B.S.Traceable.Write.Api.Application.Command.Farming;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Traceable.Write.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class FarmingController : ControllerBase
    {
        private readonly IMediator mediator;

        public FarmingController(IMediator mediator)
        {
            this.mediator = mediator;
        }

        [HttpPost]
        public Task<ApiResult<object>> CreateFarming(CreateFarmingCommand request)
        {
            return mediator.Send(request);
        }
    }
}
